package intf;


/**
 * Created by IntelliJ IDEA.
 * User: sigolaev_va
 * Date: 05.02.2013
 * Time: 14:01:19
 * Interface to the item of tree, may be a) point, b) line, connecting 2 points
 */
public interface ICommonItem
{

  boolean isLine();

  boolean isPoint();

  double distanceFrom( ICommonItem pnt);

  /**
   * Builds new item to connect to the designated point. Usually it will be {@link ILine} - to connect
   * to the point (Steiner or real). New built line is added to the parent tree of this item (point)
   * @param pnt (new) well point to connect to the tree point/line. Start point of a new connecting line will be a tree point, end point - this one
   * @return new {@link ICommonItem} instance to add to tree.
   */
  ICommonItem buildConnectItem( IPoint pnt);

  byte type();

  /**
   * Name of the item
   * @return String with item name
   */
  String name();
}
